Imports DTO
Imports System.Data.OleDb

Public Class XepTKBDAO

    Public Shared Function LayBangTKB() As DataTable
        Dim dt As New DataTable()
        Dim cn As OleDbConnection = DataProvider.ConnectionData()
        If cn.State = ConnectionState.Open Then
            Dim str$ = "select TenKhoi, TenLopHoc, TenMonHoc, TenTat, Thu, TietHocBatDau, SoTietHoc " & _
            "From LichLopHoc llh, PhanCong pc, LopHoc lh, GiaoVien gv, MonHoc mh, Khoi k " & _
            "Where llh.MaPhanCong = pc.MaPhanCong And pc.MaLopHoc = lh.MaLopHoc And pc.MaMonHoc = mh.MaMonHoc And " & _
                   "pc.MaGiaoVien = gv.MaGiaoVien And lh.MaKhoi = k.MaKhoi " & _
            "order by TenKhoi asc, TenLopHoc asc, Thu asc, TietHocBatDau asc"

            Dim dta As New OleDbDataAdapter(str, cn)
            dta.Fill(dt)
            cn.Close()
        End If
        Return dt
    End Function
End Class
